package com.songcan.common.contans;


/**
 * oauth请求缓存存储key Prifix
 */
public class CacheAuthContans {

    public  static final String AUTH_ACCESS = "yf_oauth:access:";

    /**
     * oauth 客户端信息
     */
    public  static  final  String CLIENT_DETAILS_KEY = "yf_oauth:client:details";
    /**
     * sys_oauth_client_details 表的字段，不包括client_id、client_secret
     */
   public static final String CLIENT_FIELDS = "client_id, CONCAT('{noop}',client_secret) as client_secret, resource_ids, scope, "
            + "authorized_grant_types, web_server_redirect_uri, authorities, access_token_validity, "
            + "refresh_token_validity, additional_information, autoapprove";

    /**
     * JdbcClientDetailsService 查询语句
     */
   public static final String BASE_FIND_STATEMENT = "select " + CLIENT_FIELDS
            + " from oauth_client_details";

    /**
     * 默认的查询语句
     */
   public static final String DEFAULT_FIND_STATEMENT = BASE_FIND_STATEMENT + "  order by client_id";

    /**
     * 按条件client_id 查询
     */
   public static final String DEFAULT_SELECT_STATEMENT = BASE_FIND_STATEMENT + "  where client_id = ?";

    /**
     * 协议字段
     */
    public static final String DETAILS_LICENSE = "license";
    /**
     * 前缀
     */
    public static final String PROJECT_PREFIX = "yf_";

    /**
     * 项目的license
     */
    public static final String PROJECT_LICENSE = "made by yufukaka";

    /**
     * 用户ID字段
     */
    public static final String DETAILS_USER_ID = "user_id";

    /**
     * 用户名字段
     */
    public static final String DETAILS_USERNAME = "username";

    /**
     * 用户部门字段
     */
    public static final String DETAILS_DEPT_ID = "dept_id";
}
